CREATE TABLE Smart_solicitud
(
	sm_scsolicitud INTEGER NOT NULL AUTO_INCREMENT,
	sm_nmsolicitud INTEGER NOT NULL,
	sm_fhsolicitud DATE NOT NULL,
	sm_sctercero INTEGER NOT NULL,
	sm_sctiposolicitante INTEGER NOT NULL,
	sm_scpredio INTEGER NOT NULL,
	sm_dsobservacion VARCHAR(250),
	sm_fhingreso DATE NOT NULL,
	sm_fhmodificacion DATE NOT NULL,
	sm_fhretiro DATE,
	sm_cousuario VARCHAR(150) NOT NULL,
	sm_scempresa INTEGER NOT NULL,
	PRIMARY KEY (sm_scsolicitud),
	KEY (sm_scpredio),
	KEY (sm_sctercero)
) 
;


ALTER TABLE Smart_solicitud ADD CONSTRAINT FK_Smart_solicitud_Smart_predio 
	FOREIGN KEY (sm_scpredio) REFERENCES Smart_predio (sm_scpredio)
;

ALTER TABLE Smart_solicitud ADD CONSTRAINT FK_Smart_solicitud_Smart_terceros 
	FOREIGN KEY (sm_sctercero) REFERENCES Smart_terceros (sm_sctercero)
;

